home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
CC_C
/
0335.ZIP
/
BOSS.ARC
/
BOSS.DOC
next >
Wrap
Text File
|
1986-05-28
|
31KB
|
1,336 lines
The Window BOSS
by Phil Mongelluzzo
Revision: 05.08.86
Star Guidance Consulting
273 Windy Drive
Waterbury, Connecticut 06705
(203) 574-2449
Copyright (c) 1984, 1985, 1986 by Philip A. Mongelluzzo
All Rights Reserved.
The Window BOSS distribution diskette, containing a copy of this
summary manual may be freely copied and shared, but printed
copies of this document may not be copied in any way without
permission in writing from Star Guidance Consulting. Thank you.
Introduction
The Window BOSS is one of the most powerful and cost-effective
products available to enhance and accelerate the development of
system and applications programs. The BOSS will let you create
programs that have the same look and feel as top sellers like
Lotus 1-2-3, Sidekick, dBASE III, and Framework! Pop-up windows,
pull down menus, status lines, and in context on-line help
functions can be easily implemented. Your applications can drag
windows around the screen and automatically sense the video card
installed. All of this without snow, flicker, or delay!
Registered users can take advantage of our "Source Plus" policy
that provides meticulously documented source code and one year of
free updates.
Technical Nitty Gritties
The Window BOSS supports PC/MSDOS for the IBM PC/XT/AT and
compatibles. However, you'll need one of the following
compilers in order to take advantage of the state-of-the-art
techniques available from the BOSS:
Lattice C, Microsoft C, Computer Innovations CI86
The BOSS is written in "C" and assembly. You'll need the
Microsoft Assembler MASM to compile any local changes to the
assembler source.
Stats:
Maximum windows: limited only by compiler and memory
Maximum window: full screen
Minimum window: 1 row 1 column (borderless)
3 rows 3 columns (framed)
Operation:
Simply include the library at link time and invoke the
function desired.
User Supported Software
Star Guidance Consulting distributes The Window BOSS with a
unique marketing approach called Shareware. The diskette with
the programs and manual may be freely copied and shared. It is
also available from Star Guidance for $15.00 to cover the
diskette, postage and handling. We ask you to help us distribute
The Window BOSS by sharing unmodified copies of the diskette with
others. We also encourage you to register your copy for $50.00.
You'll find a registration form at the end of this manual. Thank
you for your support and enjoy the BOSS.
Registering
Shareware is a term for software that can be freely copied and
shared. The term describes copyrighted software which the author
supports and encourages people to copy and share.
Shareware is like public television: the programming is freely
distributed, but support from users is encouraged. The concept
is based on these principles:
1. People need to try programs to see if they are useful.
2. Software authors can be supported directly by users.
3. Copying and networking of programs can be encouraged.
We encourage you to register your copy of The Window BOSS for
$50.00. Registration has a number of benefits to you:
1. Serialized diskette containing all source code for a
specific compiler.
2. Telephone Support (you pay phone charges) and free updates
for 1 year.
3. Thanks from us for your support and encouragement!
The SHAREWARE Distribution Diskette
The SHAREWARE diskette should contain the following files:
ARC.DOC <- Archive utility document
ARC.EXE <- Archive utility
BOSS.ARC <- The Window BOSS distribution archive.
BOSS.DOC <- You are reading it
After unarching BOSS.ARC:
BOSSDEMO.C <- Source to BOSSSDEMO
BOSSDEMO.EXE <- DEMO Program
CCC86.BAT <- C Compile Batch file - CI86 **
CCLAT.BAT <- C Compile Batch file - Lattice **
MCCS.BAT <- C Compile Batch file - Microsoft **
GENINDEX.C <- Source to GENINDEX
HELP.C <- Help system source
INTELC.HLP <- Demo DATA file
INTELC.NDX <- Index to Demo DATA file
LOADC86.BAT <- Link Batch file - CI86
LOADLAT.BAT <- Link Batch file - Lattice
LOADMS.BAT <- Link Batch file - Microsoft
PEEK.C <- Peek/Poke for Microsoft
POPUP.C <- Popup menu source
SC86.LIB <- Small memory library - CI86 ****
SLAT.LIB <- Small memory library - Lattice ****
SMSC.LIB <- Small memory library - Microsoft ****
WINDOWS.H <- BOSS INCLUDE file
*** These batch files were used to compile the demo
program and supporting functions. You should use these
batch files to compile "help.c" and "popup.c", or if you
are going to reconstruct BOSSDEMO.EXE. There is no other
use for these BATch files.
**** - Select one and rename to SWIN.LIB
Installation/Linking
By the numbers:
1) MAKE A BACKUP!!!
2) Use ARC to unarchive the various ARC files.
You'll need around 250k of disk space for all the files.
3) Place the LIB(s) of choice on the disk(s) you
usually use with your "C" compiler. The LIB files should
be on the same disk(s) that the "C" runtime libraries are
on.
Linking:
Simply specify the ?WIN.LIB file that corresponds to the
compiler/memory model you are using. Don't forget to
include your compilers runtime library as well. The
following examples should demonstrate the ease of linking.
Lattice
link c+bossdemo+popup+help,bossdemo,,swin+lcm+lc
Computer Innovations
link bossdemo+popup+help,bossdemo,,swin+c86s2s
Microsoft
link bossdemo+popup+help+peek,bossdemo,,swin+slibc
Sample program:
#include <windows.h>
main()
{
WINDOWPTR w1; /* window handle */
int batrib; /* border atrib */
int watrib; /* window atrib */
/*
* Set attributes:
*
* border - blue/white box
* window - white background/black letters
*
*/
batrib = v_setatr(BLUE,WHITE,0,0);
watrib = v_setatr(WHITE,BLACK,0,0);
/*
* Open window at 0,0 - 15 cells wide and 3 cells high
*/
w1 = wn_open(0,0,0,15,3,watrib,batrib);
if(!w1) exit();
/*
* Print the famous string and wait for key to be struck.
* Close window on key strike.. exit.
*/
wn_printf(w1,"Hello World...");
v_getch();
wn_close(w1);
}
/* End */
General Notes
Genindex, Help, and Popup are support programs and functions
for the BOSSDEMO program. They can, however, serve as valuable
aids to you in the creation of help screens and popup menus.
The code is provided to demonstrate how the functions in The
Window BOSS can be used to create online help screens and popup
windows.
Both the C and assembly functions make very heavy use of
pointers. The code contains numerous checks to ensure that
memory outside of that in use by the program is not corrupted.
If you attempt to do something that would cause memory to be
corrupted an error message will appear and your program will
exit. This message will usually say that a bad handle was
passed to some function. You can, if you wish, remove this
check by modifying the "error" function in the windows.c file
(registered users only).
Generally speaking, the members of the window control block (refer
to windows.h) should not be modified unless you are familiar with
how they are used by the various functions.
Cursor management is perform via the window control block members
ccx, ccy, and synflg.
Although the routines appear to support the multi page capabilities
of the IBM Color Card, actual support of this feature has not been
implemented. Invoking the functions with references to video pages
other than 0 might produce interesting but undesired results.
Two global symbols are defined and used by the various functions:
int wn_dmaflg;
int wn_sbit;
wn_dmaflg when TRUE enables direct writes into video ram. This is
the default setting and should work in all cases. Setting
wn_dmaflg to FALSE will disable these direct writes.
wn_sbit controls the window refresh rate on systems with color
cards. When set to SLOW (defined in windows.h) window displays
will appear to be painted on the screen rather than flash
displayed. Setting wn_sbit to FAST enables flash displays.
Setting wn_sbit to FAST may increase snow and flicker on color
systems.
NAME
wn_open -- open window
USAGE
wn = (WINDOWPTR)wn_open(page, row, col, width, height, atrib, batrib)
int page, row, col, width, height, atrib, batrib;
page - 0 or 1000. 1000 opens a borderless page
row - row of upper left hand corner of the window
col - column of upper left hand corner of the window
width - INSIDE dimension (max value is 78, 80 if page = 1000)
height- INSIDE dimension (max value is 23, 25 if page = 1000)
atrib - attribute to be used IN the window
batrib- attribute to be used for the border
wn_open is usually the first function called to create and use a
window. wn_open dynamically allocates memory to save the area
defined by row, col, width, and height - saves the image, opens the
window and homes the logical cursor to row 0, col 0 of the window.
The window is now ready to be used by the various window management
routines.
Attributes are defined in windows.h.
RETURNS
wn = window handle or NULL if error
CAUTIONS
Width and height are inside dimensions. If you want a window with a
work area of 10 rows and 5 columns, the width is 7 and the height is
12.
The flashing cursor will not be displayed unless wn_sync() has been
called with a value of TRUE.
NAME
wn_title -- place title on top border of window
USAGE
wn_title(wn,title)
WINDOWPTR wn;
char *title;
wn - window handle
title - string pointer to title
The title is displayed on the top border of the window using the
currently defined border attribute. The cursor is positioned off
the screen after the title is written.
RETURNS
TRUE if all is well, FALSE if the title is to large to fit on the
top border.
CAUTIONS
None.
NAME
wn_close -- close window
USAGE
wn_close(wn)
WINDOWPTR wn;
wn - handle of a previously opened window.
wn_close removes the window specified by wn and restores the screen
area under the window to its previous contents. The memory
allocated by wn_open is returned to the free list. The cursor is
positioned to where it was located prior to the wn_open call.
RETURNS
NULL if error.
CAUTIONS
None.
NAME
wn_save -- save a screen image in memory
USAGE
wn = (WINDOWPTR)wn_save(page, row, col, width, height)
int page, row, col, width, height;
page - always 0.
row - row of upper left hand corner of the window
col - column of upper left hand corner of the window
width - INSIDE dimension (max value is 78)
height- INSIDE dimension (max value is 23)
wn_save can be used to save areas of the screen for purposes other
than windows.
Memory for the screen image is dynamically allocated.
RETURNS
wn = window handle or NULL if error
CAUTIONS
The window handle returned by wn_save should only be used with
wn_restore, use with other routines could produce unpredictable
results.
NAME
wn_restore -- restore a saved screen image from memory
USAGE
wn_restore(wn)
WINDOWPTR wn;
wn - handle of previously wn_save(ed) window.
Restores the screen image corresponding to the window handle wn,
allocated memory is returned to the free list.
RETURNS
NULL if error.
CAUTIONS
This function should only be used with window handles obtained from
wn_save.
NAME wn_move(wn, row, col)
USAGE
wn = (WINDOWPTR)wn_move(wn,row,col)
wn - handle of window to be moved
row - destination row
col - destination column
Moves the window corresponding to wn to a new location. The cursor
is positioned off the screen after the call.
RETURNS
New window handle or NULL if error.
CAUTIONS
wn_move returns a new value for the window handle. Failure to
invoke this function in the as outlined under usage will produce
unpredictable results.
NAME
wn_locate -- locate (position) cursor in window
USAGE
wn_locate(wn, row, col)
WINDOWPTR wn;
int row, col;
wn - window handle
row - row to position to (relative to window origin)
col - column to position to (relative to window origin)
Position the cursor to the row and column specified. Row and
Column values are relative to the origin of the window (0,0
locates the cursor in the upper left hand corner of the window
referenced by wn).
RETURNS
Nothing.
CAUTIONS
Values of row & col are not checked.
NAME
wn_printf -- window printf
USAGE
wn_printf(wn, cs, args)
WINDOWPTR wn;
char *cs;
?? arg1 ... argn;
wn - window handle
cs - format control string
args - argument list
printf function for windows!
RETURNS
Nothing.
CAUTIONS
None.
NAME
wn_puts -- put string to window (high speed)
USAGE
wn_puts(wn, row, col, string)
WINDOWPTR wn;
int row, col;
char *string;
wn - window handle
row - row to print the string at
col - column to print the string at
string- the string to print
Row and Col are relative to the origin of the window.
The cursor is displayed only if wn_synflg has been called with
a value of TRUE.
RETURNS
NULL if error (string to large, row/col out of range)
CAUTIONS
wn_puts writes the string directly to the video ram. Tabs, line
feeds, carriage returns and other control characters are not
filtered or processed in any way.
Range checks are not performed to insure the specified string can be
contained in the window.
NAME
wn_putsa -- put string and attribute to window (high speed)
USAGE
wn_puts(wn, row, col, string, atrib)
WINDOWPTR wn;
int row, col;
char *string;
int atrib;
wn - window handle
row - row to print the string at
col - column to print the string at
string- the string to print
atrib - attribute to be used with string
Row and Col are relative to the origin of the window.
The cursor is displayed only if wn_synflg has been called with
a value of TRUE.
RETURNS
NULL if error (string to large, row/col out of range)
CAUTIONS
wn_puts writes the string directly to the video ram. Tabs, line
feeds, carriage returns and other control characters are not
filtered or processed in any way.
Range checks are not performed to insure the specified string can be
contained in the window.
NAME
wn_insrow - insert row in window
USAGE
wn_insrow(wn, row)
WINDOWPTR wn;
int row;
wn - window handle
row - row at which a line is to be inserted
Row is relative to the origin of the window. All lines below the
row specified are scrolled down. The currently defined window
attribute is used to clear the lines inserted.
RETURNS
Nothing.
CAUTIONS
None.
NAME
wn_delrow - delete row from window
USAGE
wn_delrow(wn, row)
WINDOWPTR wn;
int row;
wn - window handle
row - row at which a line is to be deleted
Row is relative to the origin of the window. All lines below the
row specified are scrolled up. The currently defined window
attribute is used to clear the lines inserted.
RETURNS
Nothing.
CAUTIONS
None.
NAME
wn_clr -- clear window
USAGE
wn_clr(wn)
WINDOWPTR wn;
wn - window handle
The window corresponding to wn is cleared (mini clear screen). The
currently defined window attribute is used to clear the interior of
the window.
The windows virtual cursor is homed.
RETURNS
Nothing.
CAUTIONS
None.
NAME
wn_color - set window & border color/attribute
USAGE
wn_color(wn, atrib, batrib)
WINDOWPTR wn;
unsigned int atrib, batrib;
wn - window handle
atrib - attribute to be used for the window
batrib- attribute to be used for the border
wn_color sets the attribute to be used for all subsequent operations
in the window. The attribute byte contains the background specific
data in the upper 4 bits and the foreground specific data in the
lower 4 bits. Color and bit definitions can be found in windows.h.
You can use a statement of the form:
atrib = (bground << 4 | fground);
to set the attribute to the correct format.
Attributes are defined in windows.h.
RETURNS
Nothing.
CAUTIONS
None.
NAME
wn_wrap - set/clear line wrap
USAGE
wn_wrap(wn, flag)
WINDOWPTR wn;
int flag;
wn - window handle
flag - wrap flag (TRUE or FALSE)
Sets the line wrap flag for window functions. If line wrap is true,
output that exceeds the width of a window is automatically placed on
the next line. When the line wrap flag is false, output that
exceeds the width of the window is lost.
RETURNS
Nothing.
CAUTIONS
None.
NAME
wn_sync -- set/clear cursor synchronization
USAGE
wn_sync(wn, flag)
WINDOWPTR wn;
int flag;
wn - window handle
flag - synchronization flag (TRUE or FALSE)
When wn_sync is called with a value of TRUE all subsequent text
output to the window will have a flashing (normal) cursor displayed
following the last character output. Calling wn_sync with a value of
false inhibits the cursor from physically advancing (it is always
logically advanced).
RETURNS
Nothing.
CAUTIONS
None.
NAME
wn_dma - set/clear the write to video ram directly flag
USAGE
wn_dma(flag)
int flag;
flag - write to video ram flag (TRUE or FALSE).
The windowing routines assume that your video card supports direct
access to the video ram (normal for monochrome monitors). However,
if you are using a standard IBM color card or you experience snow
when you write to your windows use wn_dma to set the write to video
ram flag to FALSE.
RETURNS
Nothing.
CAUTIONS
None.
NAME
wn_fixcsr - update window cursor position
USAGE
wn_fixcsr(wn)
WINDOWPTR wn;
wn - window handle
wn_fixcsr is a companion routine to wn_sync. Causes the physical
cursor to be placed at the logical cursor location. It is typically
called after wn_sync has been called to disable cursor
synchronization. wn_fixcsr does not alter the state of the windows
cursor synchronization flag.
RETURNS
Nothing.
CAUTIONS
None.
NAME
wn_boxset -- set box drawing character set
USAGE
wn_boxset(ul, ur, tb, sd, ll, lr);
int ul, ur, tb, sd, ll, lr;
ul - upper left corner character
ur - upper right corner character
tb - top/bottom line character
sd - left/right side character
ll - lower left corner character
lr - lower right corner character
wn_boxset set the characters to be used to frame all future windows.
RETURNS
Nothing.
CAUTIONS
None.
NAME
wn_dborder -- draw (replace) border on window
USAGE
wn_dborder(wn, ul, ur, tb, sd, ll, lr);
WINDOWPTR wn;
int ul, ur, tb, sd, ll, lr;
wn - window handle
ul - upper left corner character
ur - upper right corner character
tb - top/bottom line character
sd - left/right side character
ll - lower left corner character
lr - lower right corner character
wn_dborder redraws the exiting border with the characters define.
The currently defined border attribute is used when drawing the
border.
RETURNS
Nothing.
CAUTIONS
None.
NAME
_getca -- get character and attribute
USAGE
unsigned int _getca(page, row, col)
int page, row, col;
page - video page #
row - row value (0-24)
col - column value (0-79)
_getca fetches the character and attribute at the screen coordinates
defined by row and column. _getca is a general purpose routine and
can be used outside of the window environment.
RETURNS
The character and attribute as an unsigned int. The attribute is
in the upper byte, the character is in the lower byte.
CAUTIONS
None.
NAME
_putca -- put character and attribute at row,column
USAGE
_putca(page, atch, row, col);
int page, row, col;
unsigned atch;
page - video page #
atch - attribute and character
attribute in high order byte
character in low order byte
row - row position for character (0-24)
col - column position for character (0-79)
_putch is a general purpose routine that can be used outside of the
window environment.
RETURNS
Nothing.
CAUTIONS
None.
NAME
_vidblt -- video block transfer (COLOR CARD ONLY)
USAGE
_vidblt(sseg, soff, dseg, doff, n);
unsigned sseg, soff, dseg, doff;
int n;
sseg - source segment
soff - source offset
dseg - destination segment
doff - destination offset
n - number of bytes to BLT
_vidblt is similar to the lattice movedata() function except that it
waits for the video retrace signal before performing the block
transfer.
_vidblt is a general purpose function that can be used outside of
the window environment.
RETURNS
Nothing
CAUTIONS
For use in color systems only.
NAME
v_spage -- set active display page
USAGE
v_spage(page)
int page;
page - video page to switch the display to
v_spage is a general purpose routine that can be used outside of the
window environment.
RETURNS
Nothing.
CAUTIONS
None.
NAME
v_cls -- clear entire video screen
USAGE
v_cls(atrib)
int atrib;
atrib - attribute to be used
v_cls is a general purpose routine that can be used outside of the
window environment.
Attributes are defined in windows.h.
RETURNS
Nothing.
CAUTIONS
None.
NAME
v_smode -- set video mode
USAGE
v_smode(mode)
int mode;
mode - mode to set the display to
v_smode is a general purpose routine which can be used outside of
the window environment.
Modes are defined in windows.h.
RETURNS
Nothing.
CAUTIONS
None.
NAME
v_wca -- write character and attribute
USAGE
v_wca(page, char, atrib, count);
int page, char, atrib, count;
page - video page #
char - character to write
atrib - attribute to use
count - number of times two repeat
v_wca is a general purpose routine that can be used outside of the
window environment. It writes the character defined by char count
times starting at the current cursor location.
Attributes are defined in windows.h.
RETURNS
Nothing.
CAUTIONS
None.
NAME
v_locate - locate (position) cursor
USAGE
v_locate(page, row, col);
int page, row, col;
page - video page #
row - row to position to
col - column to position to
v_locate is a general purpose routine that can be used outside of
the window environment.
Row and Col are range checked. You can not position the cursor off
the screen.
RETURNS
Nothing.
CAUTIONS
None.
NAME
v_hidec -- hide cursor
USAGE
v_hidec();
The physical cursor is located off the screen.
This function does not affect any virtual cursor coordinates, it
simply hides the physical cursor from view.
RETURNS
Nothing.
CAUTIONS
None.
NAME
v_sctype -- set cursor type (style)
USAGE
v_sctype(type, start, end);
int type, start, end;
type - cursor style code (0=hidden, 1=normal, 2=slow, 3=fast)
start - start scan line
end - end scan line
As an example, to set a slow flashing block style cursor invoke this
function with type=1, start=6, and end=12 (color card).
RETURNS
Nothing.
CAUTIONS
None.
NAME
v_sapu -- scroll active display page up
USAGE
v_sapu(nl, rul, cul, rlr, clr, atrib);
int nl, rul, cul, rlr, clr, atrib;
nl - number of lines to scroll
rul - row of upper left hand corner of scroll area
cul - column of upper left hand corner of scroll area
rlr - row of lower right corner of scroll area
clr - column of lower right corner of scroll area
atrib - attribute to be used for blanking
v_sapu is a general purpose routine that can be used outside of the
window environment.
A value of 0 for nl scrolls (blanks) the entire area. To clear the
entire video screen use v_sapu(0, 0, 0, 24, 79, NORMAL).
Attributes are defined in windows.h.
RETURNS
Nothing.
CAUTIONS
None.
NAME
v_sapd -- scroll active display page down
USAGE
v_sapd(nl, rul, cul, rlr, clr, atrib);
int nl, rul, cul, rlr, clr, atrib;
nl - number of lines to scroll
rul - row of upper left hand corner of scroll area
cul - column of upper left hand corner of scroll area
rlr - row of lower right corner of scroll area
clr - column of lower right corner of scroll area
atrib - attribute to be used for blanking
v_sapd is a general purpose routine that can be used outside of the
window environment.
A value of 0 for nl scrolls (blanks) the entire area. To clear the
entire video screen use v_sapd(0, 0, 0, 24, 79, NORMAL).
Attributes are defined in windows.h.
RETURNS
Nothing.
CAUTIONS
None.
NAME
v_rcpos -- return current cursor position
USAGE
v_rcpos(page, row, col);
int page;
int *row, *col; /* POINTERS */
page - video page #
*row - pointer to int to receive row value
*col - pointer to int to receive column value
v_rcpos is a general purpose routine that can be used outside of the
window environment.
RETURNS
Nothing.
CAUTIONS
None.
NAME
v_rcvs - return current video state
USAGE
v_rcvs(page, vm, cols);
int *page, *vm, *cols; /* POINTERS */
*page - pointer to int to receive current video page #
*vm - pointer to int to receive current video mode
*cols - pointer to int to receive current screen width
v_rcvs is a general purpose routine that can be used outside of the
window environment.
Modes are defined in windows.h.
RETURNS
Nothing.
CAUTIONS
None.
NAME
v_getch -- get keyboard character and scan code
USAGE
v_getch();
v_getch is a general purpose routine that can be used outside of the
window environment.
RETURNS
The character and scan code. The character is in the low order byte,
the scan code in the high order byte.
CAUTIONS
None.
NAME
v_kstat -- get keyboard status
USAGE
v_kstat();
v_kstat is a general purpose routine that can be used outside of the
window environment.
RETURNS
TRUE if a character is available, FALSE if not.
CAUTIONS
None.
NAME
v_kflush -- flush keyboard buffer
USAGE
v_kflush();
v_kflush clears the keyboard buffer of any pending input.
RETURNS
Nothing.
CAUTIONS
None.
The Window BOSS Registration and Feedback Form
Name________________________________________________
Company_____________________________________________
Address_____________________________________________
City, State, Zip____________________________________
Daytime telephone___________________________________
To register, send $50.00 (money order, personal check, call for
CASH COD - Connecticut State residents add 7.5% sales tax) to:
Star Guidance Consulting
273 Windy Drive
Waterbury, Connecticut 06705
Likes, dislikes, features wanted, problems? List below:
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
This disk copy provided as a service of
The Public (Software) Library
the software library of
The Houston Area League of PC Users
Program disks are available for as little as $2 each and a
20-page monthly newsletter reviewing all the latest public
domain and shareware software plus a listing of all the
disks in our library is available for just $12 a year.
The Public (Software) Library
P.O.Box 61565
Houston, TX 77208